import request from "../utils/http.ts";
import type {UserLoginInfo, UserLoginRequest, UserLoginToken} from "../type/user";

export function login(loginForm: UserLoginRequest) {
    return request<UserLoginToken>({
        url: '/auth/login',
        method: 'post',
        data: loginForm
    })
    // return request.post<ResponseData<T>>('/auth/login',loginForm)
        // .then(res => res.data)
        // .catch(err => console.error(err))
}

export function getUser() {
    return request<UserLoginInfo>({
        url: '/auth/getLoginUser',
        method: 'GET',
    })
}
